import type { RouteRecordRaw } from 'vue-router'
import Layout from '@/layout/index.vue'
import Link from '@/views/link/index.vue'
export const routes: RouteRecordRaw[] = [
  {
    path: '/',
    name: 'layout',
    redirect: '/dashboard',
    component: Layout,
    meta: { title: '首页', hidden: false, isMenu: true,icon:"shouye" },
    children: [
      {
        path: 'dashboard',
        name: 'dashboard',
        meta: { title: '首页', hidden: false ,affix:true,icon:"shouye" },
        component: () => import('@/views/dashboard/index.vue')
      }
    ]
  },
  {
    path: '/system',
    name: 'system',
    meta: { title: '系统管理', hidden: false, isMenu: true ,icon:"fenjifenlei" },
    component: Layout,
    children: [
      {
        path: 'user',
        name:'user',
        meta: { title: '用户管理', hidden: false ,icon:"yonghu" },

        children: [
          {
            path: 'user-list',
            name:'user-list',
            meta: { title: '用户列表', hidden: false,icon:"duogeyonghu"  },
            component: () => import('@/views/system/user/user-list.vue')
          },
          {
            path: 'user-add',
            name:'user-add',
            meta: { title: '用户新增', hidden: true ,icon:"xinzengyonghu" },
            component: () => import('@/views/system/user/user-add.vue')
          }
        ]
      },
      {
        path: 'role',
        meta: { title: '角色管理', hidden: false },
        children: [
          {
            path: 'role-list',
            name:"role-list",
            meta: { title: '角色列表', hidden: false ,icon:"jianzhu" },
            component: () => import('@/views/system/role/role-list.vue')
          },
          {
            path: 'role-add',
            name:"role-add",
            meta: { title: '角色新增', hidden: true ,icon:"jianzhu" },
            component: () => import('@/views/system/role/role-add.vue')
          }
        ]
      }
    ]
  },
  {
    path: '/link',
    meta: { title: '友链', hidden: false, isMenu: true,icon:"jianzhu"  },
    component: Link,
    children: [
      {
        path: 'https://www.baidu.com',
        meta: { title: '百度', hidden: false, isMenu: true ,icon:"jianzhu" },
        component: Link
      },
      {
        path: 'https://cn.vuejs.org/',
        meta: { title: 'vue', hidden: false, isMenu: true ,icon:"jianzhu" },
        component: Link
      }
    ]
  },
  {
    path: '/menu',
    meta: { title: '菜单管理', hidden: false, isMenu: true,icon:"fenjifenlei"  },
    component: Layout,
    children: [
      {
        path: 'menu-1',
        meta: { title: '菜单1', hidden: false, isMenu: true,icon:"fenjifenlei"  },
        children: [
          {
            path: 'menu-1-1',
            meta: { title: '菜单1-1', hidden: false, isMenu: true ,icon:"fenjifenlei" },
            component: () => import('@/views/menu/menu1/menu1-1.vue')
          },
          {
            path: 'menu-1-2',
            meta: { title: '菜单1-2', hidden: false, isMenu: true ,icon:"fenjifenlei" },
            children: [
              {
                path: 'menu-1-2-1',
                meta: { title: '菜单1-2-1', hidden: false, isMenu: true,icon:"fenjifenlei"  },
                component: () => import('@/views/menu/menu1/menu1-2/menu1-2-1.vue')
              }
            ]
          }
        ]
      },
      {
        path: 'menu-2',
        meta: { title: '菜单2', hidden: false, isMenu: true ,icon:"fenjifenlei" },
        component: () => import('@/views/menu/menu2.vue')
      }
    ]
  },
  {
    path: '/error',
    meta: { title: '错误页面', hidden: false, isMenu: true },
    component: Layout,
    children: [
      {
        path: '404',
        meta: { title: '404', hidden: false, isMenu: true },
        component: () => import('@/views/error/404.vue')
      },
      {
        path: '403',
        meta: { title: '403', hidden: false, isMenu: true },
        component: () => import('@/views/error/403.vue')
      }
    ]
  },
  {
    path: '/:pathMatch(.*)*',
    meta: { title: '404', hidden: true },
    redirect: '/error/404'
  }
]
